<template>
	<view class="page">
		<image class="fs-full" src="/static/jc.png" mode="widthFix"></image>

		<view class="fs-full fs-py32">
			<fui-card :margin="['24rpx', '24rpx']">
				<fui-form ref="form3" labelWidth="160" labelColor="#666">
					<fui-form-item @click="handleShow" label="辅助人员" arrow highlight>
						<fui-input v-model="support_staff" placeholder="请选择辅助人员" :borderBottom="false" :padding="[0]"
							disabled backgroundColor='transparent'></fui-input>
					</fui-form-item>

					<fui-textarea :marginTop="16" label="服务详情" labelColor="#666" required requiredTop='8rpx' flexStart
						:padding="['0', '36rpx']" height="150rpx" :borderTop="false" :borderBottom="true"
						v-model="formData.service_detail" placeholder="请输入服务详情" style="box-sizing: border-box;"></fui-textarea>

					<payMethodPicker v-model:payment_way="formData.payment_way" />
					<fui-textarea :marginTop="16" label="备注" labelColor="#666" flexStart :padding="['0', '32rpx']"
						height="150rpx" :borderTop="false" :borderBottom="true" v-model="formData.remark"
						placeholder="请输入备注" style="box-sizing: border-box;"></fui-textarea>

				</fui-form>
			</fui-card>
		</view>

		<supportStaff v-model:show="show" v-model:support_renew_id="formData.support_renew_id"
			v-model:support_staff="support_staff"></supportStaff>
	</view>
</template>

<script setup>
	import { inject, ref } from 'vue';
	import cityPicker from './city-picker.vue';
	import signDatePicker from './signDatePicker.vue';
	import channelPicker from './channelPicker.vue';
	import supportStaff from './supportStaff.vue';
	import payMethodPicker from './payMethodPicker.vue';

	const formData = inject('formData');

	const show = ref(false);

	function handleShow() {
		show.value = true;
	}

	const support_staff = ref('');

	const rules = [{
			name: 'service_detail',
			rule: ['required'],
			msg: ['请输入服务详情']
		},
		{
			name: 'payment_way',
			rule: ['required'],
			msg: ['请输入支付途径']
		}
	];

	const form3 = ref(null);
	defineExpose({
		submit
	});
	async function submit() {
		const res = await form3.value.validator(formData.value, rules, true);
		return res;
	}
</script>

<style></style>